package com.insigma.business.qrcode.welfare.util;

import java.util.regex.Pattern;


public class CommonCheckUtils {
    
    private static final String REGEX_MOBILE = "((^(13|15|18|17|19)[0-9]{9}$)|(^0[1,2]{1}\\d{1}-?\\d{8}$)|(^0[3-9]{1}\\d{2}-?\\d{7,8}$)|(^0[1,2]{1}\\d{1}-?\\d{8}-(\\d{1,4})$)|(^0[3-9]{1}\\d{2}-?\\d{7,8}-(\\d{1,4})$))";

    private static final String REGEX_NOT_CHAR = "^[^a-zA-Z]*$";

    
    public static boolean checkMobile(final String mobile) {
        if (mobile == null || !Pattern.matches(REGEX_MOBILE, mobile)) {
            return false;
        }
        return true;
    }

    
    public static boolean checkNotChar(final String mobile) {
        if (mobile == null || !Pattern.matches(REGEX_NOT_CHAR, mobile)) {
            return false;
        }
        return true;
    }


}
